/* TV端样式 - DrawGuess.vue */
.game-container {
  background-color: #000;
  color: #fff;
  height: 100vh;
  padding: 15px;
  display: flex;
  flex-direction: column;

  .game-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
    position: relative;
  }

  .back-button {
    position: absolute;
    left: 0;
  }

  .game-title {
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
  }

  .back-button, .orientation-button {
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 20px;
    font-size: 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;

    &:hover {
      background: #555;
    }

    &:focus {
      outline: 2px solid #4a90e2;
      outline-offset: 2px;
    }
  }

  .connection-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 70vh;
  }

  .qrcode-container {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;

    img {
      width: 400px;
      height: 400px;
      margin: 0 auto;
    }
  }

  .server-info {
    margin-top: 20px;
    font-size: 1.2rem;
  }

  /* 确保游戏内容区域能够适应大尺寸画布 */
  .game-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
  }

  .draw-guess-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
  }

  // 游戏内容区域样式
  .game-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; // 允许flex子项收缩
  }

  .draw-guess-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    min-height: 0; // 允许flex子项收缩
  }

  .game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;

    .round-info {
      display: flex;
      align-items: center;
      gap: 10px;
      font-size: 1.3rem;

      .round-label {
        color: #ccc;
      }

      .round-value {
        color: #4a90e2;
        font-weight: bold;
      }
    }
  }

  .device-info {
    margin-bottom: 15px;
    flex-shrink: 0;

    .connected-device {
      color: #4a90e2;
      font-size: 1.1rem;
      text-align: center;

      .device-model {
        color: #ccc;
        font-size: 0.9rem;
      }
    }
  }

  // 结果消息样式
  .result-message {
    margin-top: 20px;
    text-align: center;
    flex-shrink: 0;

    .correct-message {
      color: #4CAF50;
      font-size: 1.5rem;
      font-weight: bold;
      margin-bottom: 15px;
    }

    .incorrect-message {
      color: #f44336;
      font-size: 1.5rem;
      font-weight: bold;
      margin-bottom: 15px;
    }

    .next-round-btn {
      background: #4a90e2;
      color: white;
      border: none;
      padding: 12px 24px;
      font-size: 1.2rem;
      border-radius: 8px;
      cursor: pointer;
      transition: background-color 0.2s ease;

      &:hover {
        background: #357abd;
      }

      &:focus {
        outline: 2px solid #fff;
        outline-offset: 2px;
      }
    }
  }

  // 画布容器样式 - 进一步增大画图窗口尺寸
  // .canvas-container {
  //   height: 85vh; // 进一步增大画布高度
  //   display: flex;
  //   justify-content: center;
  //   align-items: center;
  //   margin: 20px 0;
  //   min-height: 0;
  // }

  .canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;

    .drawing-canvas {
      width: auto;
      height: 95vh;
      max-width: 100%;
      max-height: 75vh;
      /* 最大高度为视口高度的95% */
      aspect-ratio: 1 / 1;
      /* 保持正方形比例 */
      border: 2px solid #ddd;
      border-radius: 8px;
      background: white;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
  }
}

// 新的侧边栏布局样式
.game-layout {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 20px;
  align-items: flex-start;
  padding: 20px;
  box-sizing: border-box;
  
  .sidebar-info {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    .game-info, .device-info {
      text-align: left;
      
      .round-info {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 15px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        align-items: center;
        text-align: center;
        
        .round-label {
          color: #aaa;
          font-size: 1.1rem;
          font-weight: 500;
          letter-spacing: 0.5px;
          width: 100%;
        }
        
        .round-value {
          color: #4a90e2;
          font-size: 1.8rem;
          font-weight: bold;
          margin-top: 5px;
          width: 100%;
        }
      }
      
      .connected-device {
        color: #4a90e2;
        font-size: 1.1rem;
        font-weight: 500;
        padding: 15px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        line-height: 1.4;
        
        .device-model {
          color: #ccc;
          font-size: 0.95rem;
          display: block;
          margin-top: 6px;
          font-weight: normal;
          text-align: center;
        }
      }
    }
  }
  
  .canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    
    .drawing-canvas {
      width: auto;
      height: 75vh;
      max-width: 100%;
      max-height: 85vh;
      aspect-ratio: 1 / 1;
      border: 2px solid #ddd;
      border-radius: 8px;
      background: white;
      box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
